export const Login=(content)=>{
    return new Promise((resolve,reject)=>{
      wx.getSetting({
        success(res) {
          if (res.authSetting['scope.userInfo'] && wx.getStorageSync('userInfo')) {
            console.log("已授权")
            // 已经授权，可以直接调用 getUserInfo 获取头像昵称
            wx.getUserInfo({
              success(res) {
                resolve(res.userInfo)
                wx.switchTab({
                  url: content,
                }) 
               
              },
              fail(res) {
                reject(res)
              }
            })
          } else {
            console.log("未授权")
            wx.navigateTo({
              url: '/pages/accredit/accredit?url='+content,
            })
          }
        }
      })
    })
  }